import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home.vue";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "Home",
    component: Home
  },
  {
    path: "/about",
    name: "About",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/About.vue")
  },
  {
    path: "/box",
    name: "Box",
    component: () => import(/* webpackChunkName: "about" */ "../views/Box.vue")
  },
  {
    path: "/mapH",
    name: "mapH",
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/HMapDemo/index.vue")
  },
  {
    path: "/groud",
    name: "groud",
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/groud.vue")
  },
  {
    path: "/building",
    name: "building",
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/building/index.vue")
  },
  {
    path: "/building2",
    name: "building2",
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/building2/index.vue")
  },
  {
    path: "/buildingMap",
    name: "buildingMap",
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/buildingMap/index.vue")
  },
  {
    path: "/babylonMap",
    name: "babylonMap",
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/babylonMap/index.vue")
  },
  {
    path: "/photo",
    name: "photo",
    component: () =>
      import(/* webpackChunkName: "photo" */ "../views/photo.vue")
  },
  {
    path: "/map",
    name: "mapPage",
    component: () =>
      import(/* webpackChunkName: "mapPage" */ "../views/map.vue"),
    children: [
      {
        path: "/map",
        redirect: "/map/heat1"
      },
      {
        path: "/map/heat1",
        name: "heat1",
        component: () =>
          import(/* webpackChunkName: "mapPage" */ "../views/heat1.vue")
      },
      {
        path: "/map/heat2",
        name: "heat2",
        component: () =>
          import(/* webpackChunkName: "mapPage" */ "../views/heat2.vue")
      },
      {
        path: "/map/line1",
        name: "line1",
        component: () =>
          import(/* webpackChunkName: "mapPage" */ "../views/line1.vue")
      },
      {
        path: "/map/line2",
        name: "line2",
        component: () =>
          import(/* webpackChunkName: "mapPage" */ "../views/dot1.vue")
      }
      // {
      //   path: "/map/line2",
      //   name: "line2",
      //   component: () =>
      //     import(/* webpackChunkName: "mapPage" */ "../views/line2.vue")
      // }
    ]
  },
  {
    path: "/terrain",
    name: "terrain",
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/terrain/index.vue")
  },
  // {
  //   path: "/cesium",
  //   name: "cesium",
  //   component: () => import(/* webpackChunkName: "about" */ "../views/cesium.vue")
  // }
  {
    path: "/css",
    name: "cssPage",
    component: () =>
      import(/* webpackChunkName: "cssPage" */ "../views/cssSerect/index.vue"),
    children: [
      {
        path: "/css",
        redirect: "/css/part1"
      },
      {
        path: "/css/part1",
        name: "part1",
        component: () =>
          import(
            /* webpackChunkName: "cssPage" */ "../views/cssSerect/part1/index.vue"
          )
      }
    ]
  },
  {
    path: "/threeDemo1",
    name: "threeDemo1",
    component: () => import(/* webpackChunkName: "three" */ "../views/three/threeDemo1/index.vue")
  },
  {
    path: "/threeMapTalk",
    name: "threeMapTalk",
    component: () => import(/* webpackChunkName: "three" */ "../views/three/threeMapTalk/index.vue")
  },
  {
    path: "/MTdemo1",
    name: "MTdemo1",
    component: () => import(/* webpackChunkName: "three" */ "../views/three/MTdemo1/index.vue")
  },
  {
    path: "/MTBuilding",
    name: "MTBuilding",
    component: () => import(/* webpackChunkName: "three" */ "../views/three/MTBuilding/index.vue")
  }
];

const router = new VueRouter({
  routes
});

export default router;
